function [llike, xi_tt_mat] = ll(Gamma, dlprice)
mu = Gamma(1);
phi = Gamma(2);
sp = exp(Gamma(3));
st = exp(Gamma(4));
%if (abs(phi) > 0.999)
%  llike = 10;
%  return;
%end
xi_tt = [0; 0];
if (abs(phi) > 0.999)
  llike = -10000;xi_tt_vec = [];
  return;
end
P_tt = [st^2/(1-phi^2), phi * st^2/(1-phi^2);
        phi * st^2/(1-phi^2), st^2/(1-phi^2)];
F = [phi 0; 1 0];
H = [1 -1]';
Q = [st^2 0; 0 0];
R = sp^2;
A = mu;
x_t = 1;
llike = 0;
xi_tt_mat = [];
for t = 1:length(dlprice)
  [xi_tt, P_tt, xi_ttm1, P_ttm1] = ...
    ecn_filter_kalman(F, Q, dlprice(t), A, x_t, H, R, P_tt, xi_tt);
  xi_tt_mat = [xi_tt_mat; xi_tt'];
  %if (length(dlprice) - t) < 40
  %    x_t = 1;
  %end
  pred_error = A' * x_t + H' * xi_ttm1 - dlprice(t);
  V = H' * P_ttm1 * H + R;
  llike = llike - 0.5 * log(V) - 0.5 * pred_error^2 / V;
end